﻿// ===============================================================================
// XCI.NET 西安交通信息WinForm开发框架 2018 版权所有
// ===============================================================================
using DevExpress.XtraWaitForm;
using System;
using XCI.Helper;

namespace XCI.Windows
{
    /// <summary>
    /// 等待窗体
    /// </summary>
    public partial class FrmWait : WaitForm
    {
        /// <summary>
        /// 
        /// </summary>
        public FrmWait()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 设置标题
        /// </summary>
        /// <param name="caption"></param>
        public override void SetCaption(string caption)
        {
            base.SetCaption(caption);
            this.progressPanel1.Caption = caption;
        }

        /// <summary>
        /// 设置消息
        /// </summary>
        /// <param name="description"></param>
        public override void SetDescription(string description)
        {
            base.SetDescription(description);
            this.progressPanel1.Description = description;
        }

        /// <summary>
        /// 处理消息
        /// </summary>
        /// <param name="cmd"></param>
        /// <param name="arg"></param>
        public override void ProcessCommand(Enum cmd, object arg)
        {
            base.ProcessCommand(cmd, arg);
            if ((WaitCommand)cmd == WaitCommand.Msg)
            {
                string msg = arg == null ? string.Empty : arg.ToString();
                SetDescription(msg);
            }
        }

    }
}